﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

using Hangjing.Model;
using Hangjing.SQLServerDAL;
using Hangjing.Common;

/// <summary>
/// 1、操作员进行订单分配之后，骑士在5分钟之内未进行订单确定的，请弹窗提醒，调度员好电话进行提醒；
///2、订单配送时间超过XX分钟未送达，系统自动提醒。
///3、订单超过xxx分钟未被任何处理，那么系统应当自动提醒。
/// 三个提醒都一起返回.
/// </summary>
public partial class qy_54tss_Admin_Service_ajax_mymsg : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Custorder dalorder = new Custorder();
        OrderDeliver dalod = new OrderDeliver();

        int cid = HjNetHelper.GetQueryInt("cid", 0);

        string sqlwhere = " ReveVar1 = '0' and Custorder.delflag = 0 and OrderDateTime > '"+DateTime.Now.AddDays(-1).ToString()+"'  and OrderStatus  <= 2  and cityid =" + cid;

        int newcount = dalorder.GetCount(sqlwhere);

        IList<OrderDeliverInfo> GPSDelaylist = dalod.deliverNotReceiveOrders(cid);
        StringBuilder sb = new StringBuilder();
        if (GPSDelaylist.Count > 0)
        {
            sb.Append("<div class='clear' style='padding-bottom:20px;'>");
            sb.Append("<span style='font-weight:bold;'>5分内配送员未接收的订单</span>");
            sb.Append("<div  style=' width:337px' class='mymsg_notice'><ul>");
            foreach (OrderDeliverInfo item in GPSDelaylist)
            {
                sb.Append("<li><a href=\"OrderDelive.aspx?type=10&oid=" + item.Orderid + "\" style='margin-left:5px;'>" + item.Orderid + "</a></li>");
            }
            sb.Append("</ul></div>");
            sb.Append("</div>");
        }

        int NotReceiveOrderscount = GPSDelaylist.Count;

        int new_weixin_order = dalorder.GetCount(sqlwhere +" and fromweb=7");


        Response.Clear();
        Response.Write(newcount+","+NotReceiveOrderscount+","+new_weixin_order);
        Response.End();
    }
}
